package com.dindang.ddm.mvp.ui.adapter.multitype;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.dindang.ddm.R;

import me.drakeet.multitype.ItemViewBinder;

/**
 * Created by cxw on 2018/2/20.
 */
public class LabelViewBinder extends ItemViewBinder<String, LabelViewBinder.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_label, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull String label) {
        holder.mTvLableName.setText(label);
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        TextView mTvLableName;
        ViewHolder(View itemView) {
            super(itemView);
            mTvLableName = itemView.findViewById(R.id.tvLabelName);
        }
    }
}
